package cdu.xjj.mapper;

import cdu.xjj.pojo.Emp;
import cdu.xjj.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;

@Mapper
public interface EmpMapper {

    /**
     * 分页查询,start是开始时间，pageSize是每页记录数,依靠PageHelper
     */
    public List<Emp> list(EmpQueryParam empQueryParam);

@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into emp(username, name, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time)"
        + "    values(#{username},#{name},#{gender},#{phone},#{job},#{salary}," +
        " #{image},#{entryDate},#{deptId},#{createTime},#{updateTime})")
    void insert(Emp emp);
}
